var order = ['green', 'red', 'yellow', 'blue', 'green'];
Page({
  data: {
    toView: 'red',
    scrollToTop: 0
  },
  onShareAppMessage() {
    return {
      title: 'scroll-view',
      path: 'page/component/pages/scroll-view/scroll-view'
    }
  },
  upper(e) {
    console.log(e)
  },
  lower(e) {
    console.log(e)
  },
  scroll(e) {
    console.log(e)
  },
  scrollToTop() {
    this.setAction({
      scrollToTop: 0
    })
  },
  tap() {
    for (let i = 0; i < order.length; i++) {
      if (this.data.toView == order[i]) {
        this.setData({
          toView: order[i + 1],
          // scrollTop:(i + 1) * 200,
        })
        break
      }
    }
  },
  tapMove() {
    this.setData({
      scrollTop: this.data.scrollTop + 20
    })
  },
})